package Array;

import java.util.*;

/**
 * Enjoy programming!!!
 * 时间： 2021/10/23 -  19:55
 */
public class Array02 {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);

        int n = in.nextInt();//仓库数
        int[] i = new int[n];//i数组存放各个仓库的颜料数
        for (int d = 1; d <= n; n++) {
             i [d] = in.nextInt();//i[d]是库号
        }
        int Q = in.nextInt();//Q即使答题次数
        for (int b = 0 ; b < Q ;b++){
            int k = in.nextInt();
            if(1 == k){
                int x = in.nextInt();
                int y = in.nextInt();
                i[x - 1] = i[x - 1] + i[y - 1];
                i[y - 1] = i[x - 1] - i[y - 1];
                i[x - 1] = i[x - 1] - i[y - 1];
                continue;
            }
            else if( 2 == k){
                int d1 = in.nextInt();
                int d2 = in.nextInt();

                if(d2 == i[d1]){
                    System.out.println("YES!");
                }
                else{
                    System.out.println("NO!");
                }
                continue;
            }
            else if(3 == k){
                int d3 = in.nextInt();
                int num = in.nextInt();

                i[d3] = num;                continue;

            }
        }
    }
}
